package com.rookie.rabbit.modular.enums;

import com.rookie.rabbit.modular.util.RabbitUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author rookie
 */

@Getter
@AllArgsConstructor
public enum BindEnum {

    /**
     * 路由键
     */
    TEST_BIND(ExchangeEnum.DEFAULT_EXCHANGE, QueueEnum.TEST_QUEUE, null, null);

    private ExchangeEnum exchangeEnum;

    private QueueEnum queueEnum;

    /**
     * 默认根据枚举名称转换
     */
    private String key;

    /**
     * 默认根据枚举名称转换
     */
    private String beanName;

    public String getKey(){
        return RabbitUtils.getDefaultRoutingKey(this,this.key);
    }
}
